package com.lizx.framework.web.smart.framework.core.wrapper;

import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * 参数包装器
 *
 * @Author: lizx
 * @Description:
 * @Date: Create in 2019/1/18 11:36 AM
 */
public class ParamWrapper {
    private Map<String, Object> paramMap = null;

    public ParamWrapper(Map<String, Object> paramMap) {
        this.paramMap = paramMap;
    }

    public long getLong(String name) {
        long value = 0;
        try {
            value = Long.valueOf(String.valueOf(paramMap.get(name)));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return value;
    }

    public Map<String, Object> getParamMap() {
        return paramMap;
    }

    public static void main(String[] args) {
        System.out.println(Long.valueOf("123"));
        System.out.println(Long.valueOf("a"));
        System.out.println(Long.valueOf("null"));
    }
}
